package com.project.service;

import com.project.daos.VehicleMapper;
import com.project.entity.Vehicle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class VehicleService {

    @Autowired
    private VehicleMapper vehicleMapper;

    public List<Vehicle> getVehicleByUid(Integer uid){
        return vehicleMapper.selVehicleByUid(uid);
    }

    public Integer addVehicle(Vehicle vehicle){
        return vehicleMapper.addVehicle(vehicle);
    }

    public Vehicle getVehicleById(Integer id){
        return vehicleMapper.selVehicleById(id);
    }

    public Integer updateVehicle(Vehicle vehicle){
        return vehicleMapper.updateVehicle(vehicle);
    }

    public Integer delVehicleByIds(Object[] ids){
        return vehicleMapper.delVehicleByIds(ids);
    }

    public Integer delVehicleByVid(Integer id){
        return vehicleMapper.delVehicleByVid(id);
    }

    public Integer updateVehiclePhoto(Vehicle vehicle){return vehicleMapper.updateVehiclePhoto(vehicle);}
}
